﻿Public Class SetBotonesPersonalizados 
    Public Sub ConstruirBotones()
        BotonesPersonalizadosSGS.ConstruirMenuRapidoFacturacion(txt1, btn1, txt2, btn2, txt3, btn3, txt4, btn4, txt5, btn5, txt6, btn6, txt7, btn7, txt8, btn8, txt9, btn9)
        BotonesPersonalizadosSGS.ConstruirMenuRapidoPlatoDinamico(txt10, btn10, txt11, btn11, txt12, btn12, txt13, btn13, txt14, btn14, txt15, btn15, txt16, btn16, txt17, btn17, txt18, btn18)
    End Sub
    Public Sub LlamadaVentanaPersonalizarBoton(ByVal textbox As System.Windows.Forms.TextBox, ByVal idBoton As Integer)
        Try
            My.Forms.SetBotonesPersonalzadosDialog.idboton.Text = idBoton.ToString
            My.Forms.SetBotonesPersonalzadosDialog.Productos.EditValue = CDec(textbox.Text)
            My.Forms.SetBotonesPersonalzadosDialog.Comentario.Text = BotonesPersonalizadosSGS.ObtenerComentarioBotonPersonalizado(idBoton)
            My.Forms.SetBotonesPersonalzadosDialog.Color.Color = textbox.BackColor
            SetBotonesPersonalzadosDialog.ShowDialog()
            ConstruirBotones()
        Catch ex As Exception
            LogSGS.RegistrarLogSinEnviarCorreo(My.Resources.StringGlobal.prgVinicio, "Error en la función (LlamadaVentanaPersonalizarBoton) en el formulario de personalización de botones de facturación", ex, My.Resources.StringGlobal.mdlGeneral, Name, "LlamadaVentanaPersonalizarBoton")
        End Try
    End Sub
    Private Sub SetBotonesPersonalizados_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DbFireAndIceDataSet.topndetalleitemespecial' table. You can move, or remove it, as needed.
        Me.TopndetalleitemespecialTableAdapter.Fill(Me.DbFireAndIceDataSet.topndetalleitemespecial)
        Try
            'TODO: This line of code loads data into the 'DbFireAndIceDataSet.Top18ItemVenta' table. You can move, or remove it, as needed.
            Me.Top18ItemVentaTableAdapter.Fill(Me.DbFireAndIceDataSet.Top18ItemVenta)
            ConstruirBotones()
        Catch ex As Exception
            LogSGS.RegistrarLogSinEnviarCorreo(My.Resources.StringGlobal.prgVinicio, "Error al cargar los productos recomendados para los botones personalizados", ex, My.Resources.StringGlobal.mdlGeneral, Name, sender.GetType.FullName.ToString)
        End Try
       
    End Sub



    Private Sub SimpleButton3_Click(sender As System.Object, e As System.EventArgs) Handles SimpleButton3.Click
        frmMensajes.ShowDialog()
    End Sub

    Private Sub btn1_Click(sender As System.Object, e As System.EventArgs) Handles btn1.Click
        LlamadaVentanaPersonalizarBoton(txt1, 1)
    End Sub

    Private Sub btn2_Click(sender As System.Object, e As System.EventArgs) Handles btn2.Click
        LlamadaVentanaPersonalizarBoton(txt2, 2)
    End Sub

    Private Sub btn3_Click(sender As System.Object, e As System.EventArgs) Handles btn3.Click
        LlamadaVentanaPersonalizarBoton(txt3, 3)
    End Sub

    Private Sub btn4_Click(sender As System.Object, e As System.EventArgs) Handles btn4.Click
        LlamadaVentanaPersonalizarBoton(txt4, 4)
    End Sub

    Private Sub btn5_Click(sender As System.Object, e As System.EventArgs) Handles btn5.Click
        LlamadaVentanaPersonalizarBoton(txt5, 5)
    End Sub

    Private Sub btn6_Click(sender As System.Object, e As System.EventArgs) Handles btn6.Click
        LlamadaVentanaPersonalizarBoton(txt6, 6)
    End Sub

    Private Sub btn7_Click(sender As System.Object, e As System.EventArgs) Handles btn7.Click
        LlamadaVentanaPersonalizarBoton(txt7, 7)
    End Sub

    Private Sub btn8_Click(sender As System.Object, e As System.EventArgs) Handles btn8.Click
        LlamadaVentanaPersonalizarBoton(txt8, 8)
    End Sub

    Private Sub btn9_Click(sender As System.Object, e As System.EventArgs) Handles btn9.Click
        LlamadaVentanaPersonalizarBoton(txt9, 9)
    End Sub

    Private Sub btn10_Click(sender As System.Object, e As System.EventArgs) Handles btn10.Click
        LlamadaVentanaPersonalizarBoton(txt10, 10)
    End Sub

    Private Sub btn11_Click(sender As System.Object, e As System.EventArgs) Handles btn11.Click
        LlamadaVentanaPersonalizarBoton(txt11, 11)
    End Sub

    Private Sub btn12_Click(sender As System.Object, e As System.EventArgs) Handles btn12.Click
        LlamadaVentanaPersonalizarBoton(txt12, 12)
    End Sub

    Private Sub btn13_Click(sender As System.Object, e As System.EventArgs) Handles btn13.Click
        LlamadaVentanaPersonalizarBoton(txt13, 13)
    End Sub

    Private Sub btn14_Click(sender As System.Object, e As System.EventArgs) Handles btn14.Click
        LlamadaVentanaPersonalizarBoton(txt14, 14)
    End Sub

    Private Sub btn15_Click(sender As System.Object, e As System.EventArgs) Handles btn15.Click
        LlamadaVentanaPersonalizarBoton(txt15, 15)
    End Sub

    Private Sub btn16_Click(sender As System.Object, e As System.EventArgs) Handles btn16.Click
        LlamadaVentanaPersonalizarBoton(txt16, 16)
    End Sub

    Private Sub btn17_Click(sender As System.Object, e As System.EventArgs) Handles btn17.Click
        LlamadaVentanaPersonalizarBoton(txt17, 17)
    End Sub

    Private Sub btn18_Click(sender As System.Object, e As System.EventArgs) Handles btn18.Click
        LlamadaVentanaPersonalizarBoton(txt18, 18)
    End Sub

  
End Class